﻿using Architecture.Api.Application.Command.UserCommand;
using Architecture.Domain.RBAC;
using Architecture.Service;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.UserHandler
{
    public class UserBackfillCommandHandler : IRequestHandler<UserBackfillCommand, UserInfo>
    {
        private readonly IUserService _userService;

        public UserBackfillCommandHandler(IUserService userService)
        {
            _userService = userService;
        }

        public async Task<UserInfo> Handle(UserBackfillCommand request, CancellationToken cancellationToken)
        {
            return await _userService.GetUserInfo(request.UserId);
        }
    }
}
